﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ObjectOuster
{
    public partial class ThemeSelector : UserControl
    {
        private void CurrentThemeChangedCallback()
        {
            Theme theme = GameConfig.Themes[GameConfig.CurrentTheme];
            titleText.Text = theme.Name;
            iconImage.Source = BitmapImageManager.GetImage(theme.IconUri);
        }
        public ThemeSelector()
        {
            InitializeComponent();
            GameConfig.OnCurrentThemeChanged += CurrentThemeChangedCallback;
            CurrentThemeChangedCallback();
        }

        private void previousThemeButton_Click(object sender, RoutedEventArgs e)
        {
            GameConfig.CurrentTheme = (GameConfig.CurrentTheme + GameConfig.Themes.Count - 1) % GameConfig.Themes.Count;
        }

        private void nextThemeButton_Click(object sender, RoutedEventArgs e)
        {
            GameConfig.CurrentTheme = (GameConfig.CurrentTheme + 1) % GameConfig.Themes.Count;
        }
    }
}
